package com.cmy.b_claculator.ui.details

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.cmy.b_claculator.R
import com.cmy.b_claculator.db.entity.WorkEntity
import com.cmy.b_claculator.model.WorkModel
import com.example.baselibrary.app.ext.setAdapterAnimation
import com.example.baselibrary.app.util.SettingUtil

class DetailsAdapter  (data: MutableList<WorkModel>) : BaseQuickAdapter<WorkModel, BaseViewHolder>(
    R.layout.item_details, data){

    init {
        setAdapterAnimation(SettingUtil.getListMode())
    }
    override fun convert(holder: BaseViewHolder, item: WorkModel) {
        holder.setText(R.id.tv_title,item.speciesName)
        holder.setText(R.id.tv_unit,item.unitName+":")
        holder.setText(R.id.tv_number,"${item.number}")
        holder.setText(R.id.tv_price,"￥${item.price}")
    }
}

